#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    int distinctAverages(vector<int>& nums) {
        vector<double> v1;
        sort(nums.begin(), nums.end());
        for (int i = 0; i < nums.size() / 2; ++i)
        {
            v1.push_back(((double)nums[i] + nums[nums.size() - 1 - i]) / 2.0);
        }
        sort(v1.begin(), v1.end());
        int count = unique(v1.begin(), v1.end()) - v1.begin();

        return count;
    }
};